# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         demo4.21
# Description:
# Author:       $赵怡蕾
# Date:         2019/1/29
#-------------------------------------------------------------------------------

spaceNum = 5                                   # 表示每一行星号一侧最多的空格数是5
i = 1
lineSpaceNum = spaceNum                        # 表示当前行的前后空格数
triangle = []                                  # 二维列表
# 开始生成三角形
while lineSpaceNum >= 0:
    # 生成星号左侧空格序列
    leftspaceList = [' ']* lineSpaceNum
    # 生成星号列表
    starList = ['*']*(2 * i - 1)
    # 生成星号右侧空格序列
    rightspecList = [' ']* lineSpaceNum
    # 生成每一行的序列
    lineList = leftspaceList  +starList + rightspecList
    triangle.append(lineList)
    lineSpaceNum -= 1
    i += 1
for line in triangle:
    print(line)